package Node;

import java.text.SimpleDateFormat;
import java.util.Date;

import sun.misc.Signal;
import sun.misc.SignalHandler;

public class SigTermHandler implements SignalHandler {
	
	private String processID;
	
	public SigTermHandler(String processID){
		
		this.processID = processID;
		
	}

	@Override
	public void handle(Signal arg0) {
		Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
        String current_time = format.format(date);
        System.out.println("Process " + processID + " going down " + current_time);
		System.exit(0);
	}

}
